#include "winProcCallBacks.h"
#include "ttMsgMap.h"
#include "btnManager.h"

int 
onDefault::runShell(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	return run(hwnd, message, wParam, lParam); 
}

int 
onDefault::run(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	return DefWindowProc(hwnd, message, wParam, lParam);
}

IMPLFUNC(onCreate, WM_CREATE)
{
	btnManager::Get()->CreateSubWindows(hwnd);
	return 1; // need default
}

IMPLFUNC(onDestroy, WM_DESTROY)
{
	PostQuitMessage(0);
	return 1;
}

IMPLFUNC(onBtnClick, WM_COMMAND)
{
	winBtn *pBtn = btnManager::Get()->getObjByMenu(LOWORD(wParam));
	if (NULL != pBtn){
		pBtn->OnButtonClick();
	}
	return 1;
}

IMPLFUNC(onPaint, WM_PAINT)
{
	return 1;
}

IMPLFUNC(onSize, WM_SIZE)
{
	return 1;
}

IMPLFUNC(onTimer, WM_TIMER)
{
	return 1;
}